package com.safewind.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static Date parse(String date) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		try {
			return sdf.parse(date);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		return null;
	}

	public static Date add(Date date, int hour, int minute) {
		Long l = date.getTime();
		l += hour * 1000 * 60 * 60 + minute * 1000 * 60;
		return new Date(l);
	}
}
